import { h } from 'vue';
import { NTag } from 'naive-ui';

export const columns = [
  {
    title: '部门名称',
    key: 'name',
  },
  {
    title: '部门级别',
    key: 'level',
  },
  {
    title: '部门排序',
    key: 'orderNum',
  },
  {
    title: '部门简介',
    key: 'description',
  },
  {
    title: '状态',
    key: 'deleted',
    render(row) {
      return h(
        NTag,
        {
          type: row.deleted === 0 ? 'success' : 'error',
        },
        {
          default: () => (row.deleted === 0 ? '启用' : '禁用'),
        }
      );
    },
  },
];
